/****************************************************************************
*  Arthea Server by R. Jennings (2007-2008)   http://arthea.googlecode.com/ *
*  By using this code you comply with the Artistic and GPLv2 Licenses.      *
****************************************************************************/


using Arthea.Boards;
using Arthea.Clans;
using Arthea.Connections;
using Arthea.Connections.Players;
using Arthea.Continents;
using Arthea.Continents.Areas;
using Arthea.Continents.Areas.Characters;
using Arthea.Continents.Areas.Items;
using Arthea.Continents.Areas.Rooms;
using Arthea.Helps;
using Arthea.Scripts;
using Arthea.Socials;

namespace Arthea.Globals
{
    /// <summary>
    /// Holds global lists.
    /// </summary>
    public struct Lists
    {
        private static readonly AreaList areas = new AreaList();
        private static readonly CharList characters = new CharList();
        private static readonly CharIndexList charIndexes = new CharIndexList();
        private static readonly ConnectionList connections = new ConnectionList();
        private static readonly ContinentList continents = new ContinentList();
        private static readonly HelpList helps = HelpList.Load();
        private static readonly ItemIndexList itemIndexes = new ItemIndexList();
        private static readonly ItemList items = new ItemList();
        private static readonly PlayerList players = new PlayerList();
        private static readonly RoomList rooms = new RoomList();
        private static readonly ScriptCodeList scripts = new ScriptCodeList();


        /// <summary>
        /// The list of connections.
        /// </summary>
        /// <value>the connection list</value>
        public static ConnectionList Connections
        {
            get { return connections; }
        }

        /// <summary>
        /// The list of characters
        /// </summary>
        /// <value>the character list</value>
        public static CharList Characters
        {
            get { return characters; }
        }

        /// <summary>
        /// The list of players
        /// </summary>
        /// <value>the list of players</value>
        public static PlayerList Players
        {
            get { return players; }
        }

        /// <summary>
        /// The list of continents
        /// </summary>
        /// <value>The list of continents</value>
        public static ContinentList Continents
        {
            get { return continents; }
        }

        /// <summary>
        /// The list of areas
        /// </summary>
        /// <value>the list of areas</value>
        public static AreaList Areas
        {
            get { return areas; }
        }

        /// <summary>
        /// The dictionary of rooms by id
        /// </summary>
        /// <value>the dictionary of rooms by id</value>
        public static RoomList Rooms
        {
            get { return rooms; }
        }

        /// <summary>
        /// The dictionary of item indexes by id
        /// </summary>
        /// <value>the item indexes</value>
        public static ItemIndexList ItemIndexes
        {
            get { return itemIndexes; }
        }

        /// <summary>
        /// The list of items
        /// </summary>
        /// <value>the list of items</value>
        public static ItemList Items
        {
            get { return items; }
        }

        /// <summary>
        /// The dictionary of character indexes by id
        /// </summary>
        /// <value>the character indexes</value>
        public static CharIndexList CharIndexes
        {
            get { return charIndexes; }
        }

        /// <summary>
        /// The list of helps
        /// </summary>
        /// <value>the help files</value>
        public static HelpList Helps
        {
            get { return helps; }
        }

        /// <summary>
        /// The list of scripts
        /// </summary>
        /// <value>the scripts</value>
        public static ScriptCodeList Scripts
        {
            get { return scripts; }
        }


        /// <summary>
        /// Saves lists that need to be saved.
        /// </summary>
        public static void Save()
        {
            Continents.Save();
            Areas.Save();
            ClanList.Save();
            Helps.Save();
            SocialList.Save();
            Players.Save();
            BoardList.Save();
        }
    }
}